package com.xiaoxin.project.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaoxin.framework.web.page.PageDomain;
import com.xiaoxin.framework.web.page.PageUtils;
import com.xiaoxin.framework.web.page.TableDataInfo;
import com.xiaoxin.framework.web.page.TableSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaoxin.project.system.mapper.SysUserMapper;
import com.xiaoxin.project.system.domain.SysUser;
import com.xiaoxin.project.system.service.SysUserService;

/**
 * @author Talk is cheap Show me the code
 * @version 1.0
 * @data 2021/5/18 22:45
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {


    @Override
    public TableDataInfo<SysUser> getUserList() {

        PageDomain pageDomain = TableSupport.buildPageRequest();
        Page<SysUser> page = new Page<>(pageDomain.getPageNum(), pageDomain.getPageSize());
        //PageUtils.startPage();
        List<SysUser> allList = baseMapper.findAllList(page);
        return PageUtils.getDataTable(allList);
    }
}
